package com.xcc.myrule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 定义随机的ribbon规则
 *  注意:需要定义在启动类OrderApplication80之外的包中
 */
@Configuration
public class MyRule {

    @Bean
    public IRule getIRule(){
        return new RandomRule(); //定义规则
    }

}
